#!/bin/bash

node_name=$1
node_ip=$2
master_ip=$3
join_token=$4

export INSTALL_K3S_MIRROR=cn
export K3S_URL=https://$master_ip:6443
export K3S_TOKEN=$join_token
export K3S_NODE_NAME=$node_name
export INSTALL_K3S_EXEC="agent --node-ip \"$node_ip\" --node-external-ip \"$node_ip\" --flannel-iface eth1"


curl -sfL https://rancher-mirror.oss-cn-beijing.aliyuncs.com/k3s/k3s-install.sh | sh -